package com.itxx.keycase.countdownLatch;

import java.util.concurrent.CountDownLatch;

public class GThread extends Thread {
   private CountDownLatch c;

    public GThread() {
    }

    public GThread(CountDownLatch c) {
        this.c = c;
    }

    @Override
    public void run() {
        try {
            sleep(30);
            for (int i = 0; i < 30; i++) {
                System.out.println(getName()+":碰见小明了  拿了他的球  练了" + (i + 1) + "投篮");
            }
            c.countDown();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
